package com.activity.activitybpm.service.impl;

import cn.hutool.core.util.StrUtil;
import com.activity.activitybpm.entity.Account;
import com.activity.activitybpm.mapper.AccountMapper;
import com.activity.activitybpm.service.AccountService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.util.CollectionUtils;
import java.util.List;


/**
 * 
 *
 * @author gnf
 * @date 2024-04-01 17:40:05
 */
@Service
public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> implements AccountService {

    @Override
    public Account getAccountUserInfo(String account, String password) {
        if (StrUtil.isBlankIfStr(account) || StrUtil.isBlankIfStr(password)) {
            return null;
        }
        List<Account> list = this.lambdaQuery().eq(Account::getAccount, account)
                .eq(Account::getAccountPwd, password)
                .eq(Account::getIsDel, 0)
                .list();
        return CollectionUtils.isEmpty(list) ? null : list.get(0);
    }
}
